<template>
	<view class="pad-lr-20">
		<view class="pad-tb-40 borderbottom" @click="gofeedbackdetails(item.id)" v-for="item in list" :key="item.id">
			<view class="display-sb align-items">
				<view class="fontSize-26 col-9">{{item.create_time}}</view>
				<view class="border-50 yuan" v-if="item.is_reply==1"></view>
			</view>
			<view class="mar-top-20 fontSize-28">
				{{item.feedback}}
			</view>
		</view>
		<view class="display-ce align-items" v-if="list?.length==0">
			<tm-result :showBtn="false" subTitle=" " title="暂无数据" color=""></tm-result>
		</view>
		<view class="poFi xiejianyi">
			<image src="/static/img/iocn_xiejianyi.png" class="width-100 height-100" @click.stop="gowritefeedback" mode=""></image>
		</view>
	</view>
</template>

<script lang="ts" setup>
// import {suggestion_list} from '@/utils/api'
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
import { ref } from 'vue';
onLoad(()=>{
	_suggestion_list()
	
})
onShow(()=>{
	uni.$on('updatayijian',()=>{
		_suggestion_list()
	})
})
onUnload(()=>{
	uni.$off('updatayijian')
})
const list = ref()
const _suggestion_list =() =>{
	suggestion_list().then(res=>{
		if(res.code==1){
			list.value = res.data.suggestion_list
		}
	})
}
//写建议
const gowritefeedback =() =>{
	uni.navigateTo({
		url:'/mypages/writefeedback/writefeedback'
	})
}
//详情
const gofeedbackdetails =(id:number) =>{
	uni.navigateTo({
		url:'/mypages/feedbackdetails/feedbackdetails?id='+id
	})
}
</script>

<style lang="scss">
@import 'feedback.scss';
</style>
